package cn.tedu;

public class TestImplementsRunnable {
    public static void main(String[] args) {
        //3.创建接口实现类对象，作为完成业务的目标类
        MyRunnable target= new MyRunnable();
        //4.创建Thread类对象，创建多线程对象
        Thread t1=new Thread();
        Thread t2=new Thread();
        Thread t3=new Thread();
        t1.start();
        t2.start();
        t3.start();
    }
}
//1.自定义线程类
    class MyRunnable implements Runnable{
    //2.添加未实现的抽象方法，完成业务
    public void run(){
        for(int i = 1;i<11;i++){
            System.out.println(i+"="+Thread.currentThread().getName());
        }

    }
}
